<?php 
namespace app\common\model\lottery;

use app\common\library\helper;
use app\common\model\BaseModel;
use app\common\model\lottery\Active;
use app\common\model\lottery\Prize;
/**
 * 
 */
class ActivePrize extends BaseModel
{
	
	protected $name ='lottery_active_prize';

	 /**
     * 关联活动会场表
     */
    public function active()
    {
        return $this->belongsTo(Active::class, 'active_id');
    }

    /**
     * 
     */
    public function prize()
    {
        return $this->belongsTo(Prize::class, 'prize_id');
    }

	 /**
	 * 活动ID获取奖品列表
	 */
    public static function getPrizeListByActiveId($active_id)
    {
        return (new static)->getLotteryPrizeByActiveId($active_id);
    }

    private function getPrizeListByIds($slotteryPrizeIds, $param = [])
    {
        return $this->getPrizeModel()->getListByIds($slotteryPrizeIds, $param);
    }

    /**
     * 
     */
    private function getLotteryPrizeByActiveId($active_id)
    {
        return $this->where('active_id', '=', $active_id)->select();
    }











}

?>